package com.ssl.tensquare.recruit.dao;

import com.ssl.tensquare.recruit.pojo.Recruit;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 描述：
 *
 * @author ssl
 * @create 2019/06/28 10:39
 */
public interface RecruitDao extends JpaRepository<Recruit, String>, JpaSpecificationExecutor<Recruit> {
    /**
     * 根据状态查询4最新4条记录，按时间倒序排列
     *
     * @param state
     * @return
     */
    List<Recruit> findTop4ByStateOrderByCreateTimeDesc(String state);

    /**
     * 最新职位列表
     *
     * @param state
     * @return
     */
    List<Recruit> findTop12ByStateNotOrderByCreateTimeDesc(String state);
}
